count occurrences of character in string python using dictionary